package com.nyist.test.dao;

import com.nyist.test.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Insert("insert into user(Username, password,phone) values(#{Username}, #{password}, #{phone})")
    int add(@Param("Username") String Username, @Param("password") String password, @Param("phone") String phone);

//    @Select("select userId, userName as userName, password as password, phone as phone from user")
    @Select("select * from user")
    List<User> findList();

}
